<?php

class Consulta1 extends CI_Controller {

    public function __construct() {
        parent::__construct();

        $this->load->library('form_validation');
        
    }
    // CON ESTE SE TRABAJA
    /**
     * Index Page for this controller.
     *
     * Maps to the following URL
     * 		http://example.com/index.php/welcome
     * 	- or -  
     * 		http://example.com/index.php/welcome/index
     * 	- or -
     * Since this controller is set as the default controller in 
     * config/routes.php, it's displayed at http://example.com/
     *
     * So any other public methods not prefixed with an underscore will
     * map to /index.php/welcome/<method_name>
     * @see http://codeigniter.com/user_guide/general/urls.html
     */
    public function index() {
     
      $data = array (
        'status' => $this->input->post("e_status"), //estatus del empleado
        'cod_b' => $this->input->post("b_CodB"), //estatus del empleado
      );
      
      
                        $this->form_validation->set_error_delimiters('<span class="mensaje-error">', '</span>');
                            if ($this->form_validation->run('Consulta1') === FALSE)
                                $this->load->view('consultas/consulta1');
                                 else{   
                                $this->load->model('consulta1DB');
                                
                                $datatotal = array (
                                'query' => $this->consulta1DB->Consulta1($data),
                                'query2' => $this->consulta1DB->Consulta1_1($data)    
                                    
                                );
                                         
                                
                                
                                $this->load->view('consultas/consulta1result',$datatotal);
                                }
      
    

    }
}